<template>
  <div class="model-sty">
    <Modal v-model="cancelPop" width="800" :mask-closable="false" class-name="vertical-center-modal">
      <div slot="header" class="pop-title">{{ $t("user.tip_title") }}</div>
      <div class="body-content">
        <Icon color="#F21473" size="28" type="ios-information-circle-outline" />{{ $t("user.tip_return_confirm") }}
      </div>
      <div slot="footer" class="footer-sty">
        <div class="cancel-btn" @click="cancelMet()">{{ $t("user.cancel") }}</div>
        <div class="confirm-btn" @click="confirmMet()">{{ $t("user.confirm") }}</div>
      </div>
    </Modal>
  </div>
</template>
<script>
import { returnOrderCancel } from "@/api/expressOrder";
export default {
  props: ['orderNo'],
  data() {
    return {
      cancelPop: false,
    }
  },
  created() {
  },
  methods: {
    cancelMet() {
      this.cancelPop = false;
    },
    confirmMet() {
      returnOrderCancel(this.orderNo).then(res => {
        if (res.code == 200) {
          this.$Message.success(this.$t('public.returnSuccess'));
          this.cancelPop = false;
          this.$parent.getDataList();//取消退货后，刷新列表
        } else {
          this.$Message.error(res.message);
        }
      }).catch(() => {
        this.cancelPop = false;
      })
    }
  }
}
</script>
<style lang="less" scoped>
:deep(.ivu-modal-header) {
  border: none;
}

:deep(.ivu-modal-footer) {
  border-top: none;
  padding-bottom: 36px;
}

.vertical-center-modal {
  display: flex;
  align-items: center;
  justify-content: center;

  .ivu-modal {
    top: 0;
  }
}

.pop-title {
  font-family: PingFang HK, PingFang HK;
  font-weight: 500;
  font-size: 24px;
  color: #1E1714;
  line-height: 28px;
}

.body-content {
  font-family: PingFang HK, PingFang HK;
  font-weight: 500;
  font-size: 18px;
  color: #333333;
  line-height: 21px;
  display: inline-flex;
  align-items: center;
}

.footer-sty {
  display: flex;
  justify-content: end;
  align-items: center;
  gap: 16px;
  margin-top: 8px;

  .cancel-btn {
    font-family: PingFang HK, PingFang HK;
    padding: 11px 40px;
    border-radius: 8px 8px 8px 8px;
    border: 1px solid #E5E5E5;
    font-weight: 400;
    font-size: 16px;
    color: #1E1714;
    line-height: 19px;
    cursor: pointer;
  }

  .confirm-btn {
    font-family: PingFang HK, PingFang HK;
    padding: 11px 40px;
    background: #F21473;
    border-radius: 8px 8px 8px 8px;
    font-weight: 500;
    font-size: 16px;
    color: #FFFFFF;
    line-height: 19px;
    cursor: pointer;
  }
}
</style>
